package utils

import "fmt"

// ConvertInterfaceSliceToStringSlice 将 []interface{} 转换为 []string
func ConvertInterfaceSliceToStringSlice(interfaceSlice []interface{}) ([]string, error) {
	var stringSlice []string
	for _, value := range interfaceSlice {
		strVal, ok := value.(string)
		if !ok {
			return nil, fmt.Errorf("value %v is not a string", value)
		}
		stringSlice = append(stringSlice, strVal)
	}
	return stringSlice, nil
}
